package com.hex.ds.hdtp.core.app.data.contrast.service;

import com.hex.ds.hdtp.core.app.data.contrast.dto.CrossDbContrastCommonDto;
import com.hex.ds.hdtp.core.app.data.contrast.dto.CrossDbContrastDataSqlDto;
import com.hex.ds.hdtp.core.app.data.contrast.dto.request.CrossDbContrastResultRequestDto;

import java.sql.SQLException;
import java.util.List;

public interface ICrossDbContrastCommonService {

    String queryContrastSceneDate(String sceneType);

    String partitionWhereSql(List<String> partitions, String date);

    CrossDbContrastDataSqlDto buildPartitionWhereSql(String sourceType, String contrastType, CrossDbContrastCommonDto contrastInfo) throws SQLException;

    /**
     * @param contrastCommon 跨库对比公共参数
     * @param runLogPkId     对比记录主键
     * @param contrastType   对比类型
     * @param contrastStatus 对比状态
     * @param errorMessage   对比异常信息
     * @Method addContrastResult
     * @Param
     * @Return void
     * @Description 新增跨库对比任务清单结果
     * @Author Wang zhihao
     * @Date 2023/7/31 20:09
     * @Version V1.0
     */
    public void addContrastResult(CrossDbContrastCommonDto contrastCommon, String runLogPkId, String contrastType, String contrastStatus, String errorMessage);
    /**
     * @Method findRootCause
     * @Param
     * @Param e
     * @Return java.lang.Throwable
     * @Description 辅助方法，递归查找根本原因
     * @Author xin.zhao
     * @Date 2023/12/6 9:23
     * @Version V1.0
     */
    public Throwable findRootCause(Throwable e);
}
